1. Field of the Invention
The present invention relates to computing systems, and more particularly, to systems that use polling to get data and negative acknowledgement protocols.
2. Background
Various techniques are used for acknowledging data and/or message packets in communication and/or computer systems (used interchangeably herein). One such technique involves ACK (Acknowledged) and NAK (Not Acknowledged) sequencing protocols. With the ACK/NAK protocols, a receiving unit acknowledges receipt of data/message packet (the terms are used interchangeably) by sending an ACK signal/packet indicating that the packet is correctly received. A NAK signal/packet is sent to indicate that there is an error in the received data or the receiving unit is busy and cannot accept data until later time, or a transmitting device cannot transmit data.
Certain systems use a “polling” technique to receive or transfer data. Under this technique a receiving system, for example, a computer system (also referred to as host system) polls a device for data. One such system that uses the polling technique is the universal serial bus (USB) system.
The USB system provides a unitary interface that allows various devices to be connected to a host system. USB enables a wide variety of peripherals to be connected in a tree-like fashion through a physical connector at the host side. USB systems comply with the USB specifications, version 1.1 and 2.0, version 2.0 published Apr. 27, 2000, which is incorporated herein by reference in its entirety.
USB systems are implemented by a register level interface standard referred to as the “Open Host Controller Interface (“OHCI”), developed by a consortium of computer industry manufacturers. The OHCI allows multiple Host Controllers to be used with a common software driver. The OHCI specification, version 1.0a, entitled “Open HCI Host Controller Interface Specification for USB, published by Compaq, Microsoft, and National Semiconductor, Jan. 22, 1997, is incorporated herein by reference in its entirety.
Yet another standard that is used by USB systems is the Universal Host Controller Interface (“UHCI”) that implements a USB Host Controller. The UHCI provides hardware and software interface between a Host Controller software driver and the Host Controller. UHCI standard published by Intel Corporation, Revision 1.1, March 1996, is incorporated herein by reference in its entirety.
Both OHCI and UHCI standards are PCI based and are mostly used in the desktop environment. Embedded applications such as cell phones, handheld devices may not run on a PCI bus. USB host controllers for embedded system are OHCI/UHCI modified since compliance to OHCI/UHCI is not required.
USB enables bi-directional isochronous and asynchronous data transfer making it possible to couple plural peripheral devices to a computing device via a single Host Controller and a USB hub. A USB hub is an intelligent wiring connector, coupled to a computing device or another hub, and which allows, attachment for peripheral devices.
USB systems allow automatic identification and configuration of external and/or internal peripheral devices. Typically, a USB host controller maintains a data structure that identifies every connected peripheral device and includes entries for communicating with the individual devices. The data structure manages four types of data transfers, between a host controller and peripheral units, namely, interrupt, isochronous, control and bulk transfers.
Interrupt transfers are periodic, small data transfers between a USB device and a client software at the host system. Isochronous transfers are periodic data transfers at a constant rate (e.g. 1 ms). Data transfer is correlated in time between a sender and receiver.
Control transfers are non-periodic data transfers used to communicate configuration/command/status information between client software and a USB device. Bulk transfers are non-periodic data transfers used to transfer large amounts of information between client software and a USB device.
OHCI/UHCI based USB systems use a microcontroller (also referred to as a host controller or USB controller), or an embedded microcontroller, uniquely suited on to a monolithic semiconductor substrate (chip) to interface between host systems and USB devices. The USB controller includes various features within a single chip, complying with the foregoing standards.
USB systems use Endpoint Descriptors (ED) and Transfer Descriptors (TD) for communication. Typically, a Host Controller Driver assigns an ED to each peripheral device or logical connection (also referred to herein as an “endpoint”) in the USB system. The ED includes information necessary for the host controller to communicate with the endpoint. The fields include maximum packet size, endpoint address, and speed of the endpoint and direction of data flow. A queue of TDs is linked to the ED for a specific endpoint. The TD includes information necessary to describe the data packets to be transferred. Each TD contains information that describes one or more data packets.
Section 4 of the OHCI specification describes the use of endpoint and transfer descriptors. Typically, an ED is a 16-byte, memory resident structure. A host controller traverses lists of EDs and if there are TDs linked to an ED, the host controller performs the indicated transfer.
OHCI is a transfer based host controller. A USB host controller can be transfer based or transaction based. For transaction based, non-PCI host controller, EDs or similar representation such as QHs (queue head) are in system memory and a host controller driver traverses the ED list. The driver loads the TDs in the host controller memory for transmittal. Transfer based host controller only process TDs belong to enabled EDs unlike a transaction based host controller where TDs are processed only when they are marked active.
In any USB system, there is a single master (USB host) who communicates with one or more slave devices (USB devices). Each endpoint communicates in one direction (e.g., an “IN” direction is from a device to the host, and the “OUT” direction is from the host to the device)
In a typical bulk IN endpoint, a USB driver operating under the operating system continuously sends via the host controller bulk data request signals (IN tokens) to the USB device(s). The USB device sends NAK signals unless some bulk data is ready to be transferred by the device. The NAKs cause congestion on the bus, which reduces the time available for the host controller to handshake or receive data from other devices. Because the host controller has to constantly poll the device which keeps sending a NAK signal, the host controller essentially wastes its resources and precious time.
Polling occurs when an ED is enabled, a TD is active or if the TD is loaded and activated for host controller processing.
Although the foregoing description highlights the congestion problem in a USB system, this problem will arise in any communication system that receives NAK signals and uses the polling technique.
Therefore, there is a need for a system that allows efficient polling without wasting precious resources.